#include "Thread.hpp"
#include "ThreadPool.hpp"
#include "Task.hpp"
#include <ctime>

#include <memory>

int main()
{
    srand(time(0));
    unique_ptr<ThreadPool<Task>> up = make_unique<ThreadPool<Task>>(5);
    up->InitStart();

    int k = 6;

    while (k--)
    {
        int a = rand() % 5 + 1;
        int b = rand() % 10 + 1;
        Task t(a, b);
        cout <<"Task => a: "<<a<<" b: "<<b<<endl;
        up->Enqueue(t);
        sleep(1);
    }

    up->Stop();
    up->Join();

    return 0;
}